﻿<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <title>部门选择</title>
</head>
<style>
.total{width: 90%;margin: auto;display: flex;flex-direction: row;justify-content: space-between;align-items: center;background-color: #fff;padding: 18px 0;border-bottom: 1px solid #DDD;}
.f14{font-size: 12px;}
.title{padding-left: 20px;}
.look{color: #2FA0EC;padding-right: 20px;}
</style>

<body style="background-color: #F3F3F3;">
    <div class="content" style="background-color: #fff;width: 100%;"></div>
    <script src="../js/jquery-2.1.4.min.js"></script>
    <script src="../js/base.js"></script>
    <script>
      $(function(){
      	loadDepartment();
      })
     
  
      //加载部门数据
      function loadDepartment() {
          ajaxGet(siteConfig.apiDomain + 'staff/GetMyDepartment?staffId=' + staffId, function (data) {
              if (!isJsonSuccess(data))
                  return;
              if (data.Code == 0) {
                  var list = data.Data;
                  var html = "<div class='total'>"
                              + "<span class='title'>全部</span>"
                              + "<span class='look f14' onclick='goPage(\"\",\"\")'>查看数据</span>"
                              + "</div>"
                  for (var i = 0; i < list.length; i++) {
                      html += "<div class='total'>"
                               + "<span class='title'>" + list[i].Name + "</span>"
                               + "<span class='look f14' onclick='goPage(" + list[i].Id + ",\"" + list[i].Name + "\")'>查看数据</span>"
                              + "</div>";
                  }
                  $(".content").append(html)
              }
          })
      }

      function goPage(id, name) {
          var backurl = getQueryString("backurl");
          if (backurl == null || backurl == '')
              backurl = "bossRadar.html?";
          window.location.href = backurl + "&DepartmentId=" + id + "&name=" + name;
      }
     
    </script>
</body>

</html>